<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02.按键修饰符</title>
</head>
<body>
<div id="app">


    <!--
        enter 按键修饰符  在回车之后触发的事件
        space 按键修饰符 空格键触发
        left 左箭头键触发 right右箭头键触发
        tab 制表键触发
        esc 退出键触发
    -->

    <input type="text" v-model="msg" @keyup.space="keyups">

    <input type="text" value="左箭头" @keyup.left="keytabs">


</div>
<!--引入vue-->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    const app = new Vue({
        el: "#app",
        data: {
            msg: "",
        },
        methods: {
            keyups() {
                console.log(this.msg);
            },
            keytabs() {
                console.log("left键触发");
            }
        }
    });
</script>
</body>
</html>